//package com.wxq.workpad.lailiao
//
//import android.content.Context
//import android.content.Intent
//import android.os.Bundle
//import androidx.fragment.app.Fragment
//import androidx.viewpager.widget.ViewPager
//import com.google.android.material.tabs.TabLayout
//import com.samluys.statusbar.StatusBarUtils
//import com.wxq.workpad.base.BaseActivity
//import com.wxq.workpad.base.RealShow
//import com.wxq.workpad.databinding.ActivityLaiLiaoMainBinding
//
//class LaiLiaoMainActivity : BaseActivity<ActivityLaiLiaoMainBinding>() {
//
//
//
//
//    private lateinit var fragments: MutableList<Fragment>
//    private lateinit var tabTitles: MutableList<String>
//    override fun initData() {
//
//    }
//
//    override fun initView(instanceState: Bundle?) {
//        StatusBarUtils.transparencyBar(this@LaiLiaoMainActivity)
//        StatusBarUtils.StatusBarIconDark(this@LaiLiaoMainActivity)
//        tabTitles = ArrayList()
//        tabTitles.add("全部")
//        tabTitles.add("待检验")
//        tabTitles.add("已检验")
//        fragments = ArrayList()
//        fragments.add(LaiLiaoFragment.newInstance(""))
//        fragments.add(LaiLiaoFragment.newInstance("1"))
//        fragments.add(LaiLiaoFragment.newInstance("2"))
//        binding.viewpager.offscreenPageLimit = 3
//        binding.viewpager.adapter =
//            LaiLiaoFragmentAdapter(supportFragmentManager, fragments, tabTitles)
//        binding.viewpager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
//            override fun onPageScrolled(
//                position: Int,
//                positionOffset: Float,
//                positionOffsetPixels: Int
//            ) {
//
//            }
//
//            override fun onPageSelected(position: Int) {
//                if (fragments.get(position) is RealShow) {
//                    (fragments.get(position) as RealShow).realShow()
//                }
//            }
//
//            override fun onPageScrollStateChanged(state: Int) {
//
//            }
//
//        })
//        binding.tabLayout.setTabMode(TabLayout.MODE_FIXED)
//        binding.tabLayout.setupWithViewPager(binding.viewpager)
//        binding.tabLayout.setTabsFromPagerAdapter(binding.viewpager.adapter)
//
//
//        binding.viewpager.setCurrentItem(0)
//        if (fragments.get(0) is RealShow) {
//            (fragments.get(0) as RealShow).realShow()
//        }
//        binding.ivBack.setOnClickListener {
//            onBackPressed()
//        }
//    }
//
//    companion object {
//
//        @JvmStatic
//        fun newInstance(context: Context) {
//            val intent = Intent(context, LaiLiaoMainActivity::class.java)
//            context.startActivity(intent)
//        }
//    }
//}